package controllers

import (
	// "encoding/json"
	// "errors"
	// "strconv"
	// "strings"
	// "ga_wz_backend/libs/encrypt"
	"gitee.com/lzqysoft/ga_wz_backend/models"

	"github.com/astaxie/beego"
)

// TempitemController operations for Tempitem
type TempitemController struct {
	CommonController
}

// URLMapping ...
func (c *TempitemController) URLMapping() {

	c.Mapping("GetAll", c.GetAll)

}

// GetAll ...
// @Title Get All by Temp
// @Description get Tempitem
// @Param	id		path 	string	true		"The key for staticblock"
// @Success 200 {object} models.Tempitem
// @Failure 403
// @router /GetAll/:id [get]
func (c *TempitemController) GetAll() {
	id := c.Ctx.Input.Param(":id")
	beego.Debug(id)
	v, err := models.GetTempitemByTemp(id)
	if err != nil {
		beego.Error(err)
		c.RetError( ErrNoData)
	}
	c.RetSuccess(v)
}
